<template>
  <div id="app">
    <indexView v-if="isLoggedIn" />
    <LoginView v-else @login-success="handleLoginSuccess" />
  </div>
</template>

<script>
import indexView from './views/indexView.vue'
import LoginView from './views/LoginView.vue'

export default {
  name: 'App',
  components: {
    indexView,
    LoginView
  },
  data() {
    return {
      isLoggedIn: false
    }
  },
  created() {
    // 检查登录状态
    const isLoggedIn = localStorage.getItem('isLoggedIn') === 'true'
    if (isLoggedIn) {
      this.isLoggedIn = true
    }
  },
  methods: {
    handleLoginSuccess() {
      this.isLoggedIn = true
    }
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}
/* 全局重置样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}
body{
  margin: 0;
}
*{

  margin: 0;
  padding: 0;
}
</style>
